Skip to content

refactor(jdbc): migrate Read Path to BigQueryTypeRegistry - #14063

Open
Neenu1995 wants to merge 8 commits into
jdbc-phase4-registry-integrationfrom
jdbc-phase4-registry-read-path
Open

refactor(jdbc): migrate Read Path to BigQueryTypeRegistry#14063
Neenu1995 wants to merge 8 commits into
jdbc-phase4-registry-integrationfrom
jdbc-phase4-registry-read-path

Conversation

@Neenu1995

@Neenu1995 Neenu1995 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

This PR migrates the BigQuery JDBC read-path implementations (Arrow and Json) to utilize the newly introduced BigQueryTypeRegistry for unified type lookups and high-performance coercion.

Also made the following fixes in implementation and tests:

  • Precision-Preserving Timestamps: Updated BigQueryTemporalUtility.boxTimestamp() to use exact BigDecimal parsing instead of Double.parseDouble, preventing sub-microsecond precision drift when reading epoch float strings from the JSON API.
  • Arrow Timezone Alignment: Anchored native Arrow LocalDateTime objects to UTC inside BigQueryTypeRegistry to ensure timestamps do not incorrectly shift based on the local JVM timezone.
  • Microsecond Precision for Time: Replaced default time extraction with BigQueryTemporalUtility.getLocalMillis() to preserve exact millisecond precision when casting LocalDateTime to java.sql.Time in the Arrow read path.
  • Struct Null-Handling Alignment: Updated BigQueryJsonStructTest to enforce standard JDBC behavior by correctly asserting that missing struct fields evaluate to null rather than falling back to incorrect primitive defaults (e.g., false or 0).
  • Test Timestamp Precision Fix: Corrected expected timestamp values in BigQueryJsonArrayOfPrimitivesTest from .8202269 to .820227 to accurately match the exact temporal data being asserted against.

@Neenu1995
Neenu1995 requested review from a team as code owners August 13, 2026 01:15

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors type conversion and mapping across the BigQuery JDBC driver by replacing BigQueryTypeCoercer and BigQueryJdbcTypeMappings with BigQueryTypeRegistry. This change requires several methods to declare throwing SQLException. The review feedback suggests keeping the parameter type as FieldValue in BigQueryJsonStruct to avoid redundant downcasts, catching Exception instead of RuntimeException in BigQueryBaseResultSet to properly handle SQLException during conversion, and removing redundant blank lines in BigQueryTypeRegistry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant